package com.example.music.service.impl;

import com.example.music.domain.Product;
import com.example.music.mapper.ProductMapper;
import com.example.music.service.IProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ProductServiceImpl implements IProductService {
    @Autowired
    private ProductMapper productMapper;
    public List<Product> getProducts(){
        return productMapper.getProducts();
    }
    public List<Product> selectProductByName(String name){
        return productMapper.selectProductByName(name);
    }
    public Product selectProductById(Long id){
        return productMapper.selectProductById(id);
    }
    public int insertProduct(Product product){
        return productMapper.insertProduct(product);
    }
    public int updateProduct(Product product){
        return productMapper.updateProduct(product);
    }
    public int deleteProductById(Long id){
        return productMapper.deleteProductById(id);
    }
}
